# -*- coding: UTF-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select
from tqdm import tqdm
import time,json,requests




driver = webdriver.Firefox()



driver.get('https://www.5199.vip/home/')

time.sleep(100)



	
while True:
	try:
		es=driver.find_element(By.CSS_SELECTOR,".sc-1f30fun-2.eQMIGV .sc-1f30fun-4.jowkKN")
		es=es.text
		es=es.encode("utf-8")
		es=es.strip()
	except Exception as e:
		raise e
	else:
		if es:
			print("获取封盘状态...　　　　　　yes")
			break

		else:
			print("获取封盘状态...　　　　　　no")
	
time.sleep(1)

while True:
	try:
		el=driver.find_element(By.CSS_SELECTOR,".sc-2bhkbz-0.fBmSuo .sc-2bhkbz-1.kVjCHR .sc-1iw0f4-0.gmwSkA.sc-heq5nv-0.sc-2bhkbz-6.hAIctb.fjBrls")
	except Exception as e:
		raise e
	else:
		if el:
			print("获取确定按钮{1}...　　　　　　yes")
			break
		else:
			print("获取确定按钮{1}...　　　　　　no")


time.sleep(1)

while True:
	try:
		qh=driver.find_element(By.CSS_SELECTOR,".sc-1ixr2qq-1.eiwGGm .sc-1ixr2qq-3.kjvYbP")
	except Exception as e:
		raise e
	else:
		if qh:
			print("获取上期期号...　　　　　　yes")
			break
		else:
			print("获取上期期号...　　　　　　no")
time.sleep(1)

while True:
	try:
		jm=driver.find_element(By.CSS_SELECTOR,".sc-l0mymw-1.kNHxYF").get_attribute('outerHTML')
	except Exception as e:
		raise e
	else:
		if jm:
			print("获取上期开奖码...　　　　　　yes")
			break
		else:
			print("获取上期开奖码...　　　　　　no")

time.sleep(1)

while True:
	try:
		is_sue=driver.find_element(By.CSS_SELECTOR,".sc-1f30fun-2.eQMIGV .sc-1f30fun-3.eXhGNg")
	except Exception as e:
		raise e
	else:
		if is_sue:
			print("获取当前期号...　　　　　　yes")
			break
		else:
			print("获取当前期号...　　　　　　no")
